function Get-CheckTypeInfo {
    $Global:check_result=@()
    $vdi_list=$RichtextboxVDI.text
    $check_value =$RichtextboxCheckValue.Text
    If( ![string]::IsNullOrWhiteSpace($vdi_list.trim()) -and![string]::IsNullOrWhiteSpace($check_value.trim()) ){
        # If( $vdi -imatch "\s" ){$vdi= "`"$vdi`""}
        # If( $check_value -imatch "\s" ){$check_value= "`"$check_value`""}
        Try{
            .\VDIInfoCollect\get_checked_result.ps1 $vdi_list $check_value $script:check_type
            $array = New-Object System.Collections.ArrayList 
            $array.AddRange($Global:check_result)
            $DataGridView.DataSource = $array
            $MainForm.refresh()
        }Catch{
            [void][System.Windows.Forms.MessageBox]::Show($_, 'Script Running Error', 'OK', 'Error')
        }Finally{}
    }
}
$ButtonOpenFile_Click={
    $result=$OpenFileDialog.ShowDialog()
    If( $result -ieq 'ok' ){
        $vdi_file=$OpenFileDialog.FileName
        $TextboxVDIName.Text= $vdi_file
        $RichtextboxVDI.Clear()
        cat $vdi_file|%{$RichtextboxVDI.AppendText("$_`n")}
    }
}
$TaskList_AfterSelect=[System.Windows.Forms.TreeViewEventHandler]{
    $select_node = $_
    if (![string]::IsNullOrWhiteSpace($select_node.Node.Tag)) {
        $script:check_type = $select_node.Node.Text
        $LabelCheckedType.Text = "$($script:check_type)`:"
        switch ($select_node.Node.Tag) {
            "VDIInfoCollect" {
                $TextboxCheckedValue.Text = switch -regex ($script:check_type) {
                    'service'     {
                        'JettyService'; break
                    }
                    'process'     {
                        'mstsc'; break
                    }
                    'reboottime'  {
                        'reboottime'; break
                    }
                }
                if ($script:check_type -imatch "reboottime") {
                    $LabelCheckedType.Hide(); $TextboxCheckedValue.Hide()
                } else {
                    $LabelCheckedType.Show(); $TextboxCheckedValue.Show()
                }
                break;
            }
            ""  {
                ""; break;
            }
            ""  {
                ""; break;
            }
            default {
                ""
            }
        }
    }
    
}